package qlsl.androiddesign.view.subview.activityview;

import com.qlsl.androiddesign.kuaiwa.R;

import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.BaseAdapter;
import qlsl.androiddesign.activity.subactivity.CollectionActivity;
import qlsl.androiddesign.activity.subactivity.CopyActivity;
import qlsl.androiddesign.activity.subactivity.PostJobActivity;
import qlsl.androiddesign.activity.subactivity.PostRecruitActivity;
import qlsl.androiddesign.activity.subactivity.RecruitListActivity;
import qlsl.androiddesign.adapter.subadapter.CategoryListAdapter;
import qlsl.androiddesign.adapter.subadapter.CruitListAdapter;
import qlsl.androiddesign.entity.otherentity.Collection;
import qlsl.androiddesign.entity.otherentity.RecruitList;
import qlsl.androiddesign.view.baseview.FunctionView;
import qlsl.androiddesign.view.subview.activityview.peoplecenterbase.PeopleCenterBaseView;

/**
 * 求职招聘页<br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
public class RecruitListView extends
		PeopleCenterBaseView<RecruitList, RecruitListActivity> {

	public RecruitListView(RecruitListActivity activity) {
		super(activity);
	}

	protected void initView(View view) {
		super.initView(view);
		setTitle("招聘求职");
	}

	protected void initData() {

		RecruitList listBean = new RecruitList();
		listBean.setName("求职");
		listBean.setDrawable(R.drawable.recruit_h);

		RecruitList listBean2 = new RecruitList();
		listBean2.setName("招聘");
		listBean2.setDrawable(R.drawable.buycar_h);

		list.add(listBean);
		list.add(listBean2);
		
		notifyDataSetChanged();

	}

	protected void initListener() {
		super.initListener();

	}

	public <T> void showData(T... t) {

	}

	public <T> void showNoData(T... t) {

	}

	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.layout_group:
			doClickListItem(view);
			break;

		default:
			break;
		}

	}

	public void doClickListItem(View view) {
		int position = refreshView.getRefreshableView()
				.getPositionForView(view);
		// RecruitList item = (RecruitList) refreshView.getAdapter().getItem(
		// position);
		if (position == 1) {// 求职
			startActivity(PostJobActivity.class);
		} else {// 招聘
			startActivity(PostRecruitActivity.class);
		}
	}

	public BaseAdapter getAdapter() {
		return new CruitListAdapter(activity, list);
	}

}
